#include <SimpleDHT.h>

#define DHTPIN 4
#define PIN 13
SimpleDHT11 dht11(DHTPIN);


void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  while(!Serial){;} //等待串口正常
  Serial.println("Humidity (%RH),\tTemperature (℃)"); 
  pinMode(PIN,OUTPUT);
  digitalWrite(PIN,LOW);//不发声音
}

void loop() {
  // start working...
  Serial.println("=================================");
  Serial.println("Sample DHT11...");
  // read without samples.
  byte temperature = 0;
  byte humidity = 0;
  int err = SimpleDHTErrSuccess;
  if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT11 failed, err="); 
    Serial.println(err);
    delay(1000);
    return;
  }
  Serial.print("Sample OK: ");
  Serial.print((int)temperature); Serial.print(" ℃, "); 
  Serial.print((int)humidity); Serial.println(" %RH");
  delay(1500);
}
